package controllers;

import play.Play;
import play.i18n.Lang;
import play.mvc.Controller;

import java.util.Arrays;

/**
 * @author Elena Kudryashova
 */
public class LangController extends Controller {
    public static void change(String lang) {
        String[] langsArray = Play.configuration.getProperty("application.langs").split(",");
        if (!Arrays.asList(langsArray).contains(lang)) {
            return;
        }
        Lang.change(lang);
        render();
    }
}
